using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for bzLog
/// </summary>
public class bzLog
{
	private dbConnection _DB = null;
    private string _TableName = "bzLog";
    private string _IDType = "_INT";
    private string _IDCol = "IDLogin";   
    private string _TableChild = "";  

    public bzLog()
	{
        _DB = new dbConnection();
	}
    public DataTable getTable( string Page,string Limit)
    {
        SqlParameter[] p = new SqlParameter[2];
        p[0] = new SqlParameter("@Page", Page);
        p[1] = new SqlParameter("@Limit", Limit);
        return _DB.getDataTable(_TableName+"_search",p);
       
    }
    public long getTotal()
    {
        return _DB.getTotalTable(_TableName + "_getTotal");
    }
    
    public int deleteRecord(string[] sID)
    {
        int count = 0;
        foreach (string str in sID)
        {
            SqlParameter[] p = new SqlParameter[4];
            p[0] = new SqlParameter("@TableName", _TableName);
            p[1] = new SqlParameter("@TableChild", _TableChild);
            p[2] = new SqlParameter("@IDCol", _IDCol);
            p[3] = new SqlParameter("@IDValue", str);
            count += _DB.updateData("bz_deleteRecord" + _IDType, p);
        }
        return count;
    }
    public int deleteMonth()
    {
        return _DB.updateData("bzLog_AutoDelete");
    }
    
}
